<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>{$meta_title}-狂雨小说CMS</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <link rel="stylesheet" href="__ADMIN__/css/admin.css">
    </head>
    <body>
    <div class="layui-fluid">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-tab layui-tab-brief">
                        <ul class="layui-tab-title">
                            <li {empty name="Request.param.type"}class="layui-this"{/empty}><a href="{:url('')}">积分中心</a></li>
                            <li {eq name="Request.param.type" value="1"}class="layui-this"{/eq}><a href="{:url('',['type'=>1])}">购买记录</a></li>
                            <li {eq name="Request.param.type" value="2"}class="layui-this"{/eq}><a href="{:url('',['type'=>2])}">出售记录</a></li>
                        </ul>
                        <div class="layui-tab-content">
                            {switch Request.param.type}
                                {case 1}
                                <div class="layui-card-body">
                                    <table class="layui-table larryms-order-demo" lay-skin="nob">
                                        <colgroup>
                                            <col width="20%">
                                            <col width="20%">
                                            <col width="15%">
                                            <col width="20%">
                                            <col>
                                        </colgroup>
                                        <thead>
                                            <tr>
                                                <th>订单号</th>
                                                <th>积分</th>
                                                <th>价格</th>
                                                <th>卖家</th>
                                                <th>购买时间</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {notempty name="list['data']"}
                                            {volist name="list['data']" id="vo"}
                                            <tr>
                                                <td>{$vo['order_id']}</td>
                                                <td>{$vo['integral']} 分</td>
                                                <td>{$vo['price']} 元</td>
                                                <td>{$vo['nickname']}</td>
                                                <td>{$vo['pay_time']|time_format="Y-m-d H:i"}</td>
                                            </tr>
                                            {/volist}
                                            {else/}
                                                <td colspan="5"> aOh! 暂时还没有内容! </td>
                                            {/notempty}
                                        </tbody>
                                    </table>
                                    <div class="page">
                                        {$page|raw}
                                    </div>
                                </div>
                                {/case}
                                {case 2}
                                <div class="layui-card-body">
                                    <table class="layui-table larryms-order-demo" lay-skin="nob">
                                        <colgroup>
                                            <col width="20%">
                                            <col width="15%">
                                            <col width="10%">
                                            <col width="10%">
                                            <col width="20%">
                                            <col>
                                        </colgroup>
                                        <thead>
                                            <tr>
                                                <th>订单号</th>
                                                <th>积分</th>
                                                <th>出售价格</th>
                                                <th>实际价格</th>
                                                <th>出售时间</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {notempty name="list['data']"}
                                            {volist name="list['data']" id="vo"}
                                            <tr>
                                                <td>{$vo['order_id']}</td>
                                                <td>{$vo['integral']} 分</td>
                                                <td>{$vo['price']} 元</td>
                                                <td>{$vo['reality_price']} 元</td>
                                                <td>{$vo['create_time']|time_format="Y-m-d H:i"}</td>
                                                <td>
                                                {eq name="vo['state']" value="0"}
                                                <button  onclick="admin_del(this,'{:url('integral_del',['id'=>$vo['id']])}')" class="layui-btn layui-btn-sm layui-btn-danger"><i class="layui-icon layui-icon-delete"></i> 取消出售</button>
                                                {/eq}
                                                </td>
                                            </tr>
                                            {/volist}
                                            {else/}
                                                <td colspan="6"> aOh! 暂时还没有内容! </td>
                                            {/notempty}
                                        </tbody>
                                    </table>
                                    <div class="page">
                                        {$page|raw}
                                    </div>
                                </div>
                                {/case}
                                {default /}
                                <div style="margin-bottom: 10px;">
                                    <button class="layui-btn layui-btn-danger" type="button" onclick="admin_show('出售积分','{:url('integral_add')}',600,345,0)"><i class="layui-icon layui-icon-add-1"></i> 出售积分</button>
                                </div>
                                <div class="layui-card-body">
                                    <table class="layui-table larryms-order-demo" lay-skin="nob">
                                        <colgroup>
                                            <col width="20%">
                                            <col width="20%">
                                            <col width="15%">
                                            <col width="20%">
                                            <col>
                                        </colgroup>
                                        <thead>
                                            <tr>
                                                <th>订单号</th>
                                                <th>积分</th>
                                                <th>价格</th>
                                                <th>卖家</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {notempty name="list['data']"}
                                            {volist name="list['data']" id="vo"}
                                            <tr>
                                                <td>{$vo['order_id']}</td>
                                                <td>{$vo['integral']} 分</td>
                                                <td>{$vo['price']} 元</td>
                                                <td>{$vo['nickname']}</td>
                                                <td>
                                                    {eq name="vo['me']" value="1"}
                                                        {eq name="vo['state']" value="0"}
                                                            <button onclick="admin_del(this,'{:url('integral_del',['id'=>$vo['id']])}')" class="layui-btn layui-btn-sm layui-btn-danger"><i class="layui-icon layui-icon-delete"></i> 取消出售</button>
                                                        {/eq}
                                                    {else/}
                                                        <button onclick="admin_show('购买积分','{:think\\facade\\Config::get('web.official_url')}/pay/{$vo['id']}/{$list['user_id']}',700,400,0,1)" class="layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon layui-icon-rmb"></i> 购买积分</button>
                                                    {/eq}
                                                </td>
                                            </tr>
                                            {/volist}
                                            {else/}
                                                <td colspan="5"> aOh! 暂时还没有内容! </td>
                                            {/notempty}
                                        </tbody>
                                    </table>
                                    <div class="page">
                                        {$page|raw}
                                    </div>
                                </div>
                            {/switch}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="__STATIC__/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/admin.js"></script>
    </body>
</html>